class UserSqlMap(object):
    PROJECT_ID_NANE = "select project_id,project_name from project"
    DEPT_ID_NAME = "select dept_id,dept_name from aoa_dept where dept_id!=1"

    USER_DEPT_ID_NAME = "select t2.dept_id,t2.dept_name from aoa_user as t1 inner join aoa_dept as t2 on t1.dept_id=t2.dept_id where t1.user_id={user_id}"
    UP_DEPT_ID = "select children_id from aoa_dept where dept_id={dept_id}"
    USER_POSITION_ID_NAME = "select t2.level,t2.position_id,t2.name as position_name from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id where t1.user_id={user_id}"
    USER_ROLE_ID_NAME = "select t1.dept_id,t2.role_value,t2.role_id,t2.role_name from aoa_user as t1 inner join aoa_role_ as t2 on t1.role_id=t2.role_id where t1.user_id={user_id}"
    PROCESS_REVIEWED_CREATE = "select t1.dept_id,t1.user_id,t1.real_name,t2.dept_name,t3.name as position_name from aoa_user as t1 inner join aoa_dept as t2 on t1.dept_id=t2.dept_id inner join aoa_position as t3 on t1.position_id=t3.position_id inner join aoa_role_ as t4 on t1.role_id=t4.role_id where t4.role_value<{role_value} and t1.dept_id={dept_id}"
    ROOT_AND_CEO = "select t1.dept_id,t1.user_id,t1.real_name,t2.dept_name,t3.name as position_name from aoa_user as t1 inner join aoa_dept as t2 on t1.dept_id=t2.dept_id inner join aoa_position as t3 on t1.position_id=t3.position_id inner join aoa_role_ as t4 on t1.role_id=t4.role_id where t4.role_value=1"

    DEEPLY_ID_NAME = "select type_id as deeply_id,type_name as deeply_name from aoa_type_list where type_model='aoa_process_list'"
    holiday_type_id_name = "select type_id,type_name from aoa_type_list where type_model='aoa_holiday'"

    PROCESS_DERATE = "select type_id,type_name from aoa_type_list where type_model='aoa_derate'"
    PROCESS_STATUS = "select status_id,status_name from aoa_status_list where status_model='aoa_process_list'"

    NOTICE_TYPE = "select type_id,type_name from aoa_type_list where type_model='inform'"
    NOTICE_STATUS = "select status_id,status_name from aoa_status_list where status_model='inform'"

    TASK_STATUS = "select status_id,status_name from aoa_status_list where status_model='aoa_task_list'"

    NOTE_TYPE = "select catalog_id,catalog_name from aoa_catalog"

    PERFORMANCE_STATUS = "select status_id,status_name from aoa_status_list where status_model='aoa_performance'"

    TRAIN_STATUS = "select status_id,status_name from aoa_status_list where status_model='aoa_train'"

    CONFIG_ID = "select config_id,process_name as config_name from aoa_process_config"

    derate_level = "select type_name,type_id from aoa_type_list where type_model='aoa_derate'"

    holiday_id_name = "select type_name,type_id from aoa_type_list where type_model='aoa_holiday'"

    subject1 = "select subject_id,name from aoa_subject where parent_id=0"
    subject2 = "select subject_id,name from aoa_subject where parent_id={subject_id}"
    subject3 = "select t1.subject_id,t1.name,t2.subject_id as last_subject_id from aoa_subject as t1 inner join aoa_subject as t2 on t1.parent_id=t2.subject_id where t1.parent_id!=0 and t1.parent_id!=1"

    NOTE_RECEIVER = "select t1.user_id,t1.user_name,t1.real_name,t3.dept_name,t2.name as position_name,user_tel from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id inner join aoa_dept as t3 on t1.dept_id=t3.dept_id inner join aoa_role_ as t4 on t1.role_id=t4.role_id where t4.role_value<{role_value}"

    TASK_PUSH = "select t1.user_id,t1.user_name,t1.real_name,t3.dept_name,t2.name as position_name,user_tel from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id inner join aoa_dept as t3 on t1.dept_id=t3.dept_id inner join aoa_role_ as t4 on t1.role_id=t4.role_id where t4.role_value>{role_value} or t1.user_id={user_id}"
    TASK_PUSH_MAX = "select t1.user_id,t1.user_name,t1.real_name,t3.dept_name,t2.name as position_name,user_tel from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id inner join aoa_dept as t3 on t1.dept_id=t3.dept_id"
    TASK_RECIVER = "select t1.user_id,t1.user_name,t1.real_name,t3.dept_name,t2.name as position_name,user_tel from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id inner join aoa_dept as t3 on t1.dept_id=t3.dept_id inner join aoa_role_ as t4 on t1.role_id=t4.role_id where t4.role_value>{role_value}"
    TASK_RECIVER_MAX = "select t1.user_id,t1.user_name,t1.real_name,t3.dept_name,t2.name as position_name,user_tel from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id inner join aoa_dept as t3 on t1.dept_id=t3.dept_id where user_id!={user_id}"

    PLAN_STATUS = "SELECT status_id,status_name FROM aoa_status_list WHERE status_model='aoa_plan_list'"
    PLAN_CYCLE = "SELECT type_id as cycle_id,type_name as cycle_name FROM aoa_type_list WHERE type_model='aoa_plan_list'"
    PLAN_TYPE = "SELECT type_id,type_name FROM aoa_type_list WHERE type_model='plan_type'"

    subject_top = "select dept_id,dept_name from aoa_dept where children_id is null"
    subject_mid = "select dept_id,dept_name from aoa_dept where children_id={dept_id}"
    subject_down = "select t1.dept_id,t1.dept_name,t2.dept_id as last_dept_id from aoa_dept as t1 inner join aoa_dept as t2 on t1.children_id=t2.dept_id where t1.children_id is not null and t1.children_id!=1"
    GET_USER_BY_DEPT = "SELECT user_id,real_name FROM aoa_user WHERE dept_id={dept_id}"
    dept_people = "select user_id,real_name from aoa_user"
    ALL_USER = "select t1.user_id,t1.user_name,t1.real_name,t3.dept_name,t2.name as position_name,user_tel from aoa_user as t1 inner join aoa_position as t2 on t1.position_id=t2.position_id inner join aoa_dept as t3 on t1.dept_id=t3.dept_id inner join aoa_role_ as t4 on t1.role_id=t4.role_id"

    GET_TYPE_BY_MODEL = "select type_name,type_id from aoa_type_list where type_model='{type_model}'"

    FILTER_PARAMS = {
        "query_str_name": "real_name like '%{query_str_name}%'"
    }
